cmake_minimum_required(VERSION 3.20)

# C 编译器
#set(CMAKE_C_COMPLIER "gcc")

# C++ 编译器
#set(CMAKE_CXX_COMPILER "g++")

# C++17 标准
set(CMAKE_CXX_STANDARD 17)

# 可执行文件输出到 bin 目录
set(EXECUTABLE_OUTPUT_PATH "../bin")

# 项目名称
project(OpenGL)

# 添加静态库
set(LIB_PATH "./external/lib")
find_library(GLEW_LIB glew32s.lib ${LIB_PATH})
find_library(SDL_IMAGE_LIB SDL2_image.lib ${LIB_PATH})
find_library(SDL_MIXER_LIB SDL2_mixer.lib ${LIB_PATH})
find_library(SDL_TTF_LIB SDL2_ttf.lib ${LIB_PATH})
find_library(SDL_MAIN_LIB SDL2main.lib ${LIB_PATH})
find_library(SDL_LIB SDL2.lib ${LIB_PATH})
find_library(ASSIMP_LIB assimp.lib ${LIB_PATH})

file(GLOB_RECURSE imgui_cpp external/src/imgui/*.cpp)
file(GLOB_RECURSE src_cpp src/*.cpp)

set(ALL_LIBS
    ${SDL_MAIN_LIB}
    ${SDL_LIB}
    ${SDL_IMAGE_LIB}
    ${SDL_MIXER_LIB}
    ${SDL_TTF_LIB}
    ${GLEW_LIB}
    pthread
    opengl32
)

# 添加宏 GLEW_STATIC
add_definitions(
    -DGLEW_STATIC
)

# include 目录
include_directories(
    "include"
<<<<<<< HEAD
    "external/include" 
=======
    "external/include"
>>>>>>> fb081ebd7478d48ac38d1ff349ec940683a48a78
    "external/include/imgui"
    "external/include/SDL2"
)

set(CPP
<<<<<<< HEAD
    src/main.cpp
    src/enviroment/uuid.cpp
    src/enviroment/input.cpp
    src/enviroment/ocwindow.cpp
    src/enviroment/application.cpp
    src/enviroment/uimage.cpp
    src/runtime/object.cpp
    src/log/logger_impl.cpp
    src/log/registry_impl.cpp
    src/timer/WheelTimer.cpp
    src/umath/umath.cpp
=======
    ${src_cpp}
>>>>>>> fb081ebd7478d48ac38d1ff349ec940683a48a78
    ${imgui_cpp}
)

# 添加可执行文件
add_executable(test ${CPP})

# 链接库到可执行文件
target_link_libraries(test ${ALL_LIBS})

add_subdirectory(test)

